<?php

namespace App\Models\Factory\V2;


use App\Helpers\RestResponseFactory;
use App\Models\AbsModelFactory;
use App\Models\Orm\Activity;
use App\Models\Orm\AwUserAccount;
use App\Models\Orm\User;


/**
 * @file AwUserAccountFactory.php
 * @brief 用户现金工厂
 * @author 
 * @version 2.*
 * @date 2017-11-25
 */
class AwUserAccountFactory extends AbsModelFactory
{

    /**
     * 初始化现金表
     * @param $identity
     * @param $labels
     * @param $amount
     * @return \Illuminate\Database\Eloquent\Collection|static[]
     */
    public static function initAccount($user_id)
    {
        $data['user_id'] = $user_id;
       $result = AwUserAccount::firstOrCreate($data);

        return $result ? true : false;

    }
}
